import request from '@/utils/request'
import apis from '@/api/index'

export function getLicenseUpload (id) {
  return request({
    url: `${apis.PgUpload}?cb_id=${id}`,
    method: 'get'
  })
}

export function postLicenseUpload (id, data) {
  return request({
    url: `${apis.PgUpload}?cb_id=${id}`,
    method: 'post',
    data: data
  })
}

export function getLicenseDownload (id) {
  return request({
    url: `${apis.PgDownload}?cb_id=${id}`,
    method: 'get'
  })
}

export function getHistory (id) {
  return request({
    url: `${apis.PgHistory}?cb_id=${id}`,
    method: 'get'
  })
}

export function getView (id) {
  return request({
    url: `${apis.PgView}?cb_id=${id}`,
    method: 'get'
  })
}

export function getMaterialTidy (parameter) {
  return request({
    url: apis.PgMaterialTidy,
    method: 'get',
    params: parameter
  })
}

export function getOffficial (parameter) {
  return request({
    url: apis.PgOfficialList,
    method: 'get',
    params: parameter
  })
}

export function getOfficialEdit (id) {
  return request({
    url: `${apis.PgOfficialEdit}?cb_id=${id}`,
    method: 'get'
  })
}

export function postOfficialEdit (id, data) {
  return request({
    url: `${apis.PgOfficialEdit}?cb_id=${id}`,
    method: 'post',
    data: data
  })
}

export function getDownloadMaterial (id) {
  return request({
    url: `${apis.PgMaterial}?cb_id=${id}`,
    method: 'get'
  })
}

export function getArrangeEdit (id) {
  return request({
    url: `${apis.PgArrangeEdit}?cb_id=${id}`,
    method: 'get'
  })
}

export function postArrangeEdit (id, data) {
  return request({
    url: `${apis.PgArrangeEdit}?cb_id=${id}`,
    method: 'post',
    data: data
  })
}

export function getCollectList (parameter) {
  return request({
    url: apis.PgCollectList,
    method: 'get',
    params: parameter
  })
}

export function getReceiptList (id) {
  return request({
    url: `${apis.PgReceiptList}?cb_id=${id}`,
    method: 'get'
  })
}

export function getReceiptState (id) {
  return request({
    url: `${apis.PgReceiptState}?cb_id=${id}`,
    method: 'get'
  })
}

export function postReceiptState (id, data) {
  return request({
    url: `${apis.PgReceiptState}?cb_id=${id}`,
    method: 'post',
    data: data
  })
}

export function getReceiptDelete (id) {
  return request({
    url: `${apis.PgReceiptDelete}?cbs_id=${id}`,
    method: 'get'
  })
}

export function getTaskList (parameter) {
  return request({
    url: apis.GetTask,
    method: 'get',
    params: parameter
  })
}

export function getAddTask (id) {
  return request({
    url: `${apis.AddTask}?id=${id}`,
    method: 'get'
  })
}

export function postAddTask (data) {
  return request({
    url: `${apis.AddTask}?id=${data.id}`,
    method: 'post',
    data: data
  })
}

export function delTask (id) {
  return request({
    url: `${apis.DelTask}?id=${id}`,
    method: 'post'
  })
}

export function getAppraiser (parameter) {
  return request({
    url: apis.GetAppraiser,
    method: 'get',
    params: parameter
  })
}

export function getAddAppraiser (id) {
  return request({
    url: `${apis.AddAppraiser}?id=${id}`,
    method: 'get'
  })
}

export function postAddAppraiser (data) {
  return request({
    url: `${apis.AddAppraiser}?id=${data.id}`,
    method: 'post',
    data: data
  })
}

export function delAppraiser (id) {
  return request({
    url: `${apis.DelAppraiser}?id=${id}`,
    method: 'post'
  })
}

export function getDetail (id) {
  return request({
    url: `${apis.TaskDetail}?id=${id}`,
    method: 'get'
  })
}

export function getQrCode (id) {
  return request({
    url: `${apis.UpdateQrCode}?id=${id}`,
    method: 'get'
  })
}

export function batchUpload (data) {
  return request({
    url: apis.ImportCase,
    method: 'post',
    data: data
  })
}
